#include <iostream>
#include <algorithm>
//#include <algorithm>
#include <string>
#include <vector>
#include <map>
using namespace std;

struct Compare
{
    bool operator()(const pair<string, int>& x, const pair<string, int>& y) const
    {
        return x.second > y.second;
    }
};

int main()
{
    map<string, int> m;
    string s;
    while (cin >> s)
    {
        if (isupper(s[0]))
        {
            s[0] = tolower(s[0]);
        }

        if (s.back() == '.')
        {
            s.pop_back();
            m[s]++;
            break;
        }
        else
        {
            m[s]++;

        }

    }

    vector<pair<string, int>> v(m.begin(), m.end());
    sort(v.begin(), v.end(), Compare());


    for(int i = 0;i < v.size();i++)
    {

        cout << v[i].first << ":" << v[i].second << endl;
    }
    return 0;
}